<template>
  <div>
    <div class="box" v-html="data"></div>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        data:[],//存储文章详情数据
      }
    },
    mounted () {
      // 获取上一个页面传过来的文章id
      let id=this.$route.query.id
      // console.log(id);
      // 发送请求,获取文章详情
      this.axios.get(`/user/detail?id=${id}`).then(res=>{
        // 查看文章详情
        // console.log(res);
        this.data=res.data.data[0].content
      })
    },
  }
</script>

<style lang="scss" scoped>
.box{
  border: 1px solid #000;
  width: 70vw;
  min-height: 90vh;
  margin: auto;
  padding:30px 50px;
}
</style>